#include <stdio.h>
/*
	AT
	AT+RST
	AT+CWMODE=1
	AT+CWJAP="llll","12345678" 
	AT+CIFSR 
	AT+MQTTUSERCFG=0,2,"S&D13U5401U78S3&144&13","guest","guest",0,0,""
	AT+MQTTCONN=0,"k7161331.ala.cn-hangzhou.emqxsl.cn",8883,1
	AT+MQTTPUB=0,"/144/D13U5401U78S3/info/post","{\"stat us\"\: 3\,\"userId\"\: 1}",0,0
*/

void string_concat(char *dest, const char *src) 
{
    while (*dest != '\0') {
        dest++;
    }
    while (*src != '\0') {
        *dest++ = *src++;
    }
    *dest = '\0';
}

char* publishMQTTMessage(const char* topic, const char* payload) 
{
    static char command[300]; 
    snprintf(command, sizeof(command),
             "AT+MQTTPUB=0,\"%s\",\"%s\",0,0",
             topic, payload);
    return command;
}